<?php

use yii\helpers\Html;
use yii\widgets\DetailView;

/* @var $this yii\web\View */
/* @var $model app\modules\Cruise\models\Cruise */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Cruises'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
//Yii::$app->formatter->defaultTimeZone = "PRC";
?>
<div class="cruise-view">

    <h2 class="page-header"><?= Html::encode($this->title) ?>
        <p class="pull-right"> 
            <?= Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']) ?>
            <?= Html::a(Yii::t('app', 'Index'), ['index'], ['class' => 'btn btn-danger']) ?>
        </p>
    </h2>

    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            //'id',
            //'supplier_id',
            [
                'attribute' => 'supplier_id',
                'value' => $model->supplier->company,
            ],
            'name',
            'en_name',
            [
                'attribute' => 'from_city',
                'value' => isset(Yii::$app->params['city'][$model->from_city]) ? Yii::$app->params['city'][$model->from_city] : '(未设置)',
            ],
            [
                'attribute' => 'to_city',
                'value' => isset(Yii::$app->params['city'][$model->to_city]) ? Yii::$app->params['city'][$model->to_city] : '(未设置)',
            ],
            'weight:decimal',
            'num:decimal',
            'length',
            'width',
            'room:decimal',
            'ceil',
            'speed',
            'first',
            'renovation',
            'desc',
            [
                'attribute' => 'status',
                'value' => Yii::$app->params['status'][$model->status],
            ],
            //'user_id',
            'created_at:datetime',
            'updated_at:relativeTime',
        ],
    ]) ?>

</div>
